<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆页面</title>
    <link rel="stylesheet" type="text/css" href="../public/css/login.css">
	<link rel="stylesheet" type="text/css" href="../public/css/xcConfirm.css"/>
	<script src="../public/js/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="../public/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
        $(function(){
            $(".name input").focus(function(){
                $(this).prev("i").css({"background-image":"url(../public/img/user2.png)"});
            });
            $(".name input").blur(function(){
                $(this).prev("i").css({"background-image":"url(../public/img/user1.png)"});
            });
            $(".password input").focus(function(){
                $(this).prev("i").css({"background-image":"url(../public/img/password2.png)"});
            });
            $(".password input").blur(function(){
                $(this).prev("i").css({"background-image":"url(../public/img/password1.png)"});
            });
        });
    </script>
</head>
<body>
    <div class="container">
        <div class="wrap">
            <header><em>Mslx</em><span>沐水莲心-在线考试系统</span></header>
            <article>
                <section>
                    <aside>
                        <em>
                            <img src="../public/img/user.png">
                        </em>
                         <form method="post" action="../model/validate.php">
                            <p class="name"><i></i><input type="text" name="name" id="user" required placeholder="请输入用户名"></p>
                            <p class="password"><i></i><input type="password" name="password" id="pass" required placeholder="请输入密码"></p>
                            <button id="login_btn">登录</button>
                            <p class="remember"><input type="checkbox" name="remember">记住密码</p>
                            <p class="regist"><span>没有账号?</span><a href="./regist.html">立即注册</a></p>
                            <div class="clear"></div>
                        </form>
                    </aside>
                   
                </section>               
            </article>
            <footer>
                <p>本网页用于设计在线考试卷系统</p>
            </footer>
        </div>
    </div>
</body>
</html>
<script >
	$(function(){
		$("#login_btn").on('click',function(){

			var selectuser = $("#user").val();
			var pword = $("#pass").val();

			if (selectuser == "" || selectuser.length <= 1) {
				//alert("用户名不能为空");
				window.wxc.xcConfirm("用户名不能为空");
				$("#user").focus();
				return false;
			}
			if (pword == "" || pword.length < 1) {
				//alert("密码不能为空");
				window.wxc.xcConfirm("密码不能为空");
				$("#pass").focus();
				return false;
			}
			
		
		});
	});

</script>
